# -*- coding:utf-8 -*-
from pydantic import Field
from pydantic import BaseModel
from sqlalchemy import Column, Integer, String
from core.curd import Base, TimestampMixin

class SysAttach(Base, TimestampMixin):
    """
    测试表
    """
    __tablename__ = 'sys_attachment'

    id = Column(Integer, nullable=False, autoincrement=True, primary_key=True, comment='id')
    name = Column(String(100), comment='附件名称')
    url = Column(String(100), comment='附件地址')
    path = Column(String(100), comment='附件地址')
    size = Column(Integer, comment='附件大小')
    platform = Column(String(100), comment='存储平台')
    md5 = Column(String(64), comment='摘要')


class CreateSysAttach(BaseModel):
    name: str = Field(comment='附件名称', max_length=100)
    url: str = Field(comment='附件地址', max_length=100)
    path: str = Field(comment='附件地址', max_length=100)
    size: int = Field(comment="排序", default=0)
    platform: str = Field(comment="存储平台")
    md5: str = Field(comment="摘要")